import common from "./common";
(function (doc, win) {
  const docEl = doc.documentElement,
    resizeEvt = "orientationchange" in window ? "orientationchange" : "resize",
    recalc = () => {
      const clientWidth = docEl.clientWidth;
      if (common.isMobile()) {
        docEl.style.fontSize = 50 * (clientWidth / 375) + "px";
        docEl.classList.remove("pc");
      } else {
        docEl.classList.add("pc");
        docEl.style.fontSize = "50px";
      }
    };
  if (!doc.addEventListener) return;
  win.addEventListener(resizeEvt, recalc, false);
  doc.addEventListener("DOMContentLoaded", recalc, false);
})(document, window);
